# p102
vowels = ['a','e','i','o','u']
word = input("provide a word to search for vowels:")
found = []                # 创建一个空列表
for letter in word:
    if letter in vowels:
        if letter not in found:
            found.append(letter)      # 添加字母
for vowel in found:
    print(vowel)

# p113
vowels = ['a','e','i','o','u']
word = input("provide a word to search for vowels:")
found = {}

found['a'] = 0
found['e'] = 0
found['i'] = 0
found['o'] = 0
found['u'] = 0

for letter in word:
    if letter in vowels:
        found[letter] += 1
for k,v in sorted(found.items()):
    print(k,'was found',v,'time(s).')

# p120
vowels=['a','e','i','o','u']
word=input('请输入想要检测的字符串')
found={}
for letter in word:
    if letter in vowels:
        found.setdefault(letter,0)
        found[letter]+=1
for k,v in sorted(found.items()):
    print(k,'was found',v,'times')

# p124-130
vowels = set('aeiou')
word = input("provide a word to search for vowels:")
found = vowels.intersection(set(word))
for vowel in found:
    print(vowel)
